<?php
namespace app\model\admin;

use think\Db;

class Column
{
    //获取栏目列表
    public function get_column_lists($where,$sort='',$paginate=10)
    {
        $result_lists = Db::name('column')->where($where)->order($sort)->paginate($paginate);
        return $result_lists;
    }
    //获取栏目列表(非分页模式)
    public function get_column_select($where,$sort='')
    {
        $result_lists = Db::name('column')->where($where)->order($sort)->select();
        return $result_lists;
    }

    //栏目详情
    public function column_detail($column_id){
        $result = Db::name('column')->where('id',$column_id)->find();
        return $result;
    }

    //栏目详情
    public function column_detail_seo($column_name){
        $result = Db::name('column')->where('seo_name_en',$column_name)->find();
        return $result;
    }

    //栏目添加
    public function add_column($data){
        $status = Db::name('column')->insert($data);
        return $status;
    }

    //栏目修改
    public function update_column($where,$data){
        $status = Db::name('column')->where($where)->update($data);
        return $status;
    }

    //栏目删除
    public function delete_column($array_id){
        $advert_delete = Db::name('column')->delete($array_id);
        return $advert_delete;
    }

}


